package com.woniuxy.api;

import com.woniu.cloud.common.dto.Result;
import com.woniuxy.form.InsertGoodOrder;
import com.woniuxy.form.InsertGoodOrderDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "kaer-order",contextId = "ProductOrderDetailApi")
public interface ProductOrderDetailApi {
    /**
     *
     * @param indexPage 分页查询页数
     * @param goodOrderId 用户商品订单id
     * @return  ipage
     *
     *  分页查询用户订单详情
     */
    @GetMapping("/getProductOrderDetailByUserId")
    Result getProductOrderDetailByUserId(@RequestParam("indexPage") Integer indexPage,@RequestParam("goodOrderId") Integer goodOrderId);


    /**
     *
     * @param storeId 门店Id
     * @param indexPage 分页查询页数
     * @param goodOrderId  用户商品订单id
     * @return
     *
     * 门店分页查询用户订单详情
     */
    @GetMapping("/getProductOrderDetailByStroe")
    Result getProductOrderDetailByStore(@RequestParam("storeId") Integer storeId,@RequestParam("indexPage") Integer indexPage,@RequestParam("goodOrderId") Integer goodOrderId);
    /**
     *
     * @param indexPage 分页页数
     * @param goodOrderId 用户商品订单  id
     * @return  ipage
     *
     * 平台分页查询用户订单详情
     *
     */
    @GetMapping("/getProductOrderDetailByPlatform")
    Result getProductOrderDetailByPlatform(@RequestParam("indexPage") Integer indexPage,
                                           @RequestParam("goodOrderId") Integer goodOrderId);

    /**
     *
     * @param insertGoodOrderDetail
     * @return
     *
     * 增加订单详情表数据 ，当增加了商品订单表时，就调用该接口
     */
    @PostMapping("/insertProductOrderDetail")
    Result insertProductOrderDetail(@RequestBody InsertGoodOrderDetail insertGoodOrderDetail) throws InterruptedException;

    @GetMapping("/getProductOrderDetailByProductOrderId")
    Result getProductOrderDetailByProductOrderId(@RequestParam("goodOrderId") Integer goodOrderId);
}
